package com.tzbank.esbService;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;

import org.springframework.beans.factory.annotation.Autowired;

import com.dc.eai.data.CompositeData;
import com.dcfs.esb.server.service.Service;
import com.tzbank.consumer.CommonServiceScheduler;
import com.tzbank.consumer.FingerprintServiceScheduler;
import com.tzbank.esbService.util.CodeUtil;
import com.tzbank.esbService.util.EsbConversionUtil;
import com.tzbank.esbService.util.GeneralSeqNo;
import com.tzbank.esbService.util.PropertiesUtil;
import com.tzbank.services.CommonEsbService;
import com.tzbank.utils.SpringContextUtils;

import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONObject;

@Slf4j
public class EsbServiceImpl implements Service {


	CommonEsbService commonEsbService = SpringContextUtils.getBeanByName("commonEsbService");


	/**
	 * 该类是发布在ESB在人脸服务的实现类 获取报文参数然后执行业务代码，之后再组装报文返回 详情如下：
	 * 
	 * @param data
	 * 
	 * @return 响应报文
	 */

	public CompositeData exec(CompositeData data) {

		//environment.getProperty("aa", String.class);
		log.info("==========进入ESB服务========");
		CompositeData result = new CompositeData();
		// 转换输入参数
		Map<String, Object> inputMap = EsbConversionUtil.compositeDataToMap(data);
		result=commonEsbService.commonEsbService(inputMap);

		return result;
	}

}
